isImportantForAccessibility
Computes whether this view should be exposed for accessibility. In general, views that are interactive or provide information are exposed while views that serve only as containers are hidden.
If an ancestor of this view has importance IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, this method returns false
.
Otherwise, the value is computed according to the view's getImportantForAccessibility value:
- IMPORTANT_FOR_ACCESSIBILITY_NO or IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, return
false
- IMPORTANT_FOR_ACCESSIBILITY_YES, return
true
- IMPORTANT_FOR_ACCESSIBILITY_AUTO, return
true
if view satisfies any of the following: - Is actionable, e.g. isClickable, isLongClickable, or isFocusable
- Has an AccessibilityDelegateCompat
- Has an interaction listener, e.g. View.OnTouchListener, View.OnKeyListener, etc.
- Is an accessibility live region, e.g. getAccessibilityLiveRegion is not ACCESSIBILITY_LIVE_REGION_NONE.
Note: Prior to API 21, this method will always return true
.
Return
Whether the view is exposed for accessibility.
Parameters
view
view for which to check the state.